package com.itheima.mapper;

import com.itheima.pojo.CheckGroup;
import com.itheima.pojo.Menu;
import com.itheima.pojo.Permission;
import com.itheima.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    List<Role> findAll();

    List<Integer> findRoleIdsByUserId(@Param("id") Integer id);
    void add(Role role);

    void setRoleAndPermission(@Param("permissionIds")Integer[] permissionIds, @Param("id")Integer id);

    void setRoleAndMenu(@Param("menuIds")Integer[] menuIds, @Param("id")Integer id);

    List<Role> findByCondition(@Param("queryString")String queryString);

    Role findById(@Param("id")Integer id);

    void deleteAssociation1(@Param("id")Integer id);
    void deleteAssociation2(@Param("id")Integer id);

    Integer findCountById(@Param("id")Integer id);

    void deleteById(@Param("id")Integer id);

    List<Permission> findPermission();

    List<Menu> findMenu();

    void edit(Role role);

    List<Integer> findPermissionIdsByRoleId(@Param("id")Integer id);
    List<Integer> findMenuIdsByRoleId(@Param("id")Integer id);
}
